<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>颜色</title>
    <style>
        h1 {
            /*颜色赋值的5种方式*/
            color: red;
            color: #00ff00;
            color: #00f;
            color: rgb(255, 0, 0);
            color: rgba(255, 0, 0, 0.1);
        }

        #d1 {
            width: 200px; /*设置区域的宽*/
            height: 200px; /*设置区域的高*/
            background-color: purple; /*设置区域的背景颜色*/
            background-image: url("../b.jpg"); /*设置背景图片*/
            background-size: 100px 100px; /*设置背景图片的尺寸*/
            background-repeat: no-repeat; /*设置背景图片禁止重复*/
            background-position: 20px 50px; /*设置背景图片的位置:横向偏移值 纵向偏移值*/
            background-position: 50% 50%; /*设置背景图片的位置:横向偏移百分比 纵向偏移百分比*/
        }

        #d2 {
            width: 611px;
            height: 376px;
            background-color: #e8e8e8;
            background-image: url("http://doc.vrd.net.cn/tstore_v1/images/itemCat/study_computer_img1.png");
            background-size: 318px 319px;
            background-repeat: no-repeat;
            background-position: 90% 60%;
        }

        #d3 {
            width: 375px;
            height: 376px;
            background-color: #e8e8e8;
            background-image: url("http://doc.vrd.net.cn/tstore_v1/images/itemCat/study_computer_img2.png");
            background-size: 292px 232px;
            background-repeat: no-repeat;
            background-position: 80% 90%;
        }
    </style>
</head>
<body>
<div id="d1"></div> <!--div#d1+Tab键-->
<div id="d2"></div>
<div id="d3"></div>
<div class="c1"></div> <!--div.c1+Tab键-->

<h1>颜色测试</h1>

</body>
</html>